<?php
class markers_handler implements handler{
	function run($task,$params=array()){
		global $core,$result;
		$search=$core->getApp("search");
			$resultados=$search->searchbounds($task);
	    if(!count($resultados)){
	      $result["error"]="2";
	      $result["errorDescription"]='$$sin_resultados$$';
	      $result["type"]="bounds";
		  $result["results"]=array();
	      $result["query"]=$task;
	      }
	    else {
	      $chunk=$core->getChunk("jsonResults");
	      $result["error"]="0";
	      $result["errorDescription"]="OK";
	      $result["resultCount"]=count($resultados);
	      $result["results"]=$chunk->out(array("api"=>true));
	      $result["type"]="bounds";
	      $result["query"]=$task;

    }
	}
}